home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vcls / texec / readme.txt < prev    next >
Text File  |  1996-04-08  |  2KB  |  63 lines

  1. TExec Component for Delphi.
  2. Uploaded by 100524,2162 Dave Taylor.
  3.  
  4. Component to run another Windows app.
  5. Runs WINEXEC. Progname & params specified in strings
  6. can wait for app to complete, before continuing.
  7.  
  8. Source code is in DEXEC.PAS
  9. Toolbar icon is in DEXEC.DCR
  10.  
  11. Use Delphi main screen 'Options' to Install the component.
  12. Appears on 'System' toolbar 
  13.  
  14. Properties:    
  15.  
  16. .Progname = Drive/Directory/Name of program to execute
  17. .Progparams = Optional parameters for program
  18. .Show    = Normal, Minimized, Maximized
  19.  
  20. .Wait = True causes wait for called task to finish before return
  21. .Wait = False returns immediately
  22.  
  23. .Timeout = 0 (When Wait=True, waits until called program is closed)
  24. .Timeout = n (When Wait=True, returns after n seconds even if program is still running)
  25.  
  26. Feedback:
  27.  
  28. .ReturnCode = 0 everything happened OK
  29. .ReturnCode = 1 error
  30. .ReturnCode = 2 timeout occured
  31.  
  32. .Reasoncode = n (when .ReturnCode = 1 gives windows error code)
  33. .Message = text (when .ReturnCode = 1 gives meaning of error code)
  34.  
  35. .Instance (If exec worked, instance of started task)
  36.  
  37. Methods:
  38.  
  39. .Exec   Runs the command
  40.  
  41. Example:
  42.  
  43. Exec1.Progname:='NOTEPAD.EXE';
  44. Exec1.Progparams:='WIN.INI';
  45. Exec1.Show:=Normal;
  46. Exec1.Wait:=True;
  47. Exec1.Timeout:=30;
  48. Exec1.Exec;
  49.  
  50. Runs NOTEPAD to edit WIN.INI.  
  51. Waits until NOTEPAD is closed or 30 seconds elapsed before returning.
  52.             
  53. Note: you should maybe hide or disable the form before using Exec with Wait=True ? 
  54.  
  55. or
  56.  
  57. var p1,p2: array [0..255] of char;
  58. begin
  59. exec1.progname:='c:\windows\notepad.exe';
  60. exec1.exec;
  61. if exec1.returncode<>0 then
  62.    messagebox(form1.handle,strpcopy(p1,exec1.message),strpcopy(p2,'myapp'),mb_iconstop+mb_ok);
  63. end;